Machine vision systems may be used to inspect objects based on their color(s). In industrial applications, such vision systems may inspect the colors of, for example, work pieces, produce, and color-coded pills. Color may be an important indicator of whether a colored component is properly positioned in a work piece, whether produce is ripe or overripe, or whether a particular color-coded pill is in the proper location in its container. Such vision systems may also be used in medical applications to determine the composition of cells, in which different cell components are dyed different colors.
The objects under inspection may be moving on a conveyor belt. Hence, the speed of image processing in the vision system may be an important factor for operational efficiency. The object under inspection may be imaged in a frame of pixels, for example, an array of 680xc3x97480 pixels. Each pixel represents the instantaneous value of an optical quality (e.g., color) of the image at a location corresponding to the pixel""s position in the frame.
It may be desirable to detect a transition between two colors on an object. For example, a package may contain dark green pills and light green pills in specified locations. If a dark green pill is detected in a location allocated for a light green pill, the package may be considered defective. However, when scanning for dark green pills and light green pills in the package, the sides of the light green pills may include shadows that would cause them to appear dark green to the vision system. This could result in the system erroneously flagging the package as defective. However, by enabling the vision system to identify whether there is a transition between light green and dark green on the same pill, and instructing the system to consider such an occurrence acceptable, such errors may be avoided.
Detecting color transitions may be accomplished by comparing the color of each pixel to that of each of its neighbors. Each pixel in a two dimensional array may have up to eight neighboring pixels. An operation for examining this many pixels may require first storing the image in a frame buffer and then performing a number of search algorithms on the image. Such operations may utilize significant processing resources and may not be performed in real time.
Accordingly, it may be desirable to provide a machine vision system that determines color transitions in a scanned image in real time.
A color transition counting device according to an embodiment may include a number of transition counting channels. Each channel may include a frame memory and a read out circuit for reading out pixels from the frame memory in a particular pattern. Each channel may also include a transition counter that examines a string of pixels and determines if a valid transition between two colors exists in that string. If so, this transition may be counted and stored in the counter corresponding to that color transition.
The frame memories may be read out at a dot clock rate in horizontal, vertical, diagonal, and cross-diagonal patterns simultaneously by the associated read out circuits. The number of transition detected in each readout operations for that frame may be counted and then added together and this number read out by a host computer.
The device may also include a counting block that includes different counters for different pixel colors of interest. According to an embodiment, the pixels may be one of eight colors. These colors may be keyed colors.